<?php
    session_start();
    include('top.php');
    include('../sql.php');
    $article = "select * from article order by time desc";
    $article_result = $link->query($article);
?>
<div class="home-container-body">
    <?php include('nav.php'); ?>
</div>
<div class="admin_hone-content">
    <table width="100%" style="margin-top: 12px;">
        <tr>
            <td>文章标题</td>
            <td>发布时间</td>
            <td>操作</td>
        </tr>
        <?php while($article_row = mysqli_fetch_array($article_result)) { ?>
        <tr>
            <td><?php echo $article_row['title']; ?></td>
            <td><?php echo date("Y-m-d H:i:s", $article_row['time']) ?></td>
            <td><a href="update.php?id=<?php echo $article_row['id']; ?>">修改</a> <a href="control.php?action=delarticle&id=<?php echo $article_row['id']; ?>">删除</a></td>
        </tr>
        <?php } ?>
    </table>
</div>
<?php include('bottom.php'); ?>